<template>
  <div id="cqShishiPage" class="view">
    <game-header :caipiaoTerm='caipiaoTermCon' :caipiaoName='caipiaoName'></game-header>
    <el-tabs  type="border-card" v-model="activeName" @tab-click='changeTab'>
      <el-tab-pane v-for="item in gameArr" :key="item.order" :label="item.backup1" :name="item.order">
        <el-tabs  v-model="activeName2">
          <el-tab-pane v-for="p in item.children" :key="p.order2" :label="p.name" :name="p.order2">
          	<component :is="p.myTab" :caipiaoTerm='caipiaoTermCon' :childArr = "p"></component>
          </el-tab-pane>
        </el-tabs>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
  import header from '../../gamesub/header'
  import dxds from './play/dxds'
  import bdwd from './play/bdwd'
  import exzx from './play/exzx'
  import rxwf from './play/rxwf'
  import sxwf from './play/sxwf'
  import sxzx from './play/sxzx'
  import x4wf from './play/4xwf'
  import x5wf from './play/5xwf'
  export default {
    data () {
      return {
      	caipiaoName: '重庆时时彩',
        activeName: '0',
        activeName2: '0',
        ticketId: 22,
        caipiaoTerm: 1,
        caipiaoTermCon: 2123123123,
        gameArr: []
      }
    },
    created () {
      let arr = this.$store.state.allGameList
    	arr.forEach(item => {
    		if(item.ticketId === this.ticketId) {
    			this.gameArr = item.list
    		}
    	})
    	console.log(this.gameArr)
    },
    methods: {
    	changeTab () {
    		this.activeName2 = "0"
    	}
    },
    components: {
      'game-header': header,
      'my-bdwd': bdwd,
      'my-dxds': dxds,
      'my-exzx': exzx,
      'my-rxwf': rxwf,
      'my-sxzx': sxzx,
      'my-sxwf': sxwf,
      'my-4xwf': x4wf,
      'my-5xwf': x5wf
    }
  }
</script>

<style lang="less">
  #cqShishiPage{
    /*border:1px solid #ccc;*/
    .el-tabs--border-card>.el-tabs__header .el-tabs__item.is-active{
      background-color: #f13131;
      color: white;
    }
    .content {
      background-color: #fff;
      border-bottom: 1px solid #ddd;
    }

  }
</style>
